extends CharacterBody2D

@export var start: Marker2D
@export var end: Marker2D
@export var speed: float = 30.0
var tween := create_tween()
@onready var startPos := start.position
@onready var endPos := end.position


func _ready() -> void:
	show()
	position = startPos
	tween.tween_property(self, "position", endPos, startPos.distance_to(endPos) / speed)
	tween.tween_property(self, "position", startPos, startPos.distance_to(endPos) / speed)
	tween.set_loops()
